home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 6589 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.6 KB

  1. Path: erich.triumf.ca!bennett
  2. From: bennett@erich.triumf.ca (P.Bennett)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Why won't this compile????
  5. Date: 17 Feb 1996 14:52 PST
  6. Organization: TRIUMF: Tri-University Meson Facility
  7. Distribution: world
  8. Message-ID: <17FEB199614525629@erich.triumf.ca>
  9. References: <4g50et$9lh@steel.interlog.com>
  10. NNTP-Posting-Host: ftp.triumf.ca
  11. News-Software: VAX/VMS VNEWS 1.50    
  12.  
  13. In article <4g50et$9lh@steel.interlog.com>, kingkaos@interlog.com (King Kaos) writes...
  14. >    Hi.  Can someone please explain why this program won't
  15. >compile without errors?  I am using Power C under DOS.
  16.  
  17. <snip...>
  18. >    swap(&var1, &var2);
  19. >    printf("Variables after swap");
  20. >    printf("var1 = %d , var2 = %d\n,var1,var2);
  21. >}
  22. >And, heres the C.ERR file:
  23. >pointc~1.txt(18):}
  24. >****************                ^202
  25. >      202: String constant cannot span lines
  26.  
  27. Look carefully at the printf() statement I left above - I think you will find
  28. that you left off the closing quotes. The compiler therefore thinks that the
  29. "string constant" ("var1 = %d, var2 = %d\n,var1,var2....) goes beyond the end
  30. of that line.
  31.  
  32. The rest of the error messages are probably as a result of the compiler getting
  33. confused here, and should go away when you fix this (but I didn't check the
  34. remaining code...)
  35.  
  36. Peter Bennett VE7CEI                | Vessels shall be deemed to be in sight
  37. Internet: bennett@triumf.ca         | of one another only when one can be
  38. Packet: ve7cei@ve7kit.#vanc.bc.ca   | observed visually from the other
  39. TRIUMF, Vancouver, B.C., Canada     |                          ColRegs 3(k)
  40. GPS and NMEA info and programs: ftp://sundae.triumf.ca/pub/peter/index.html
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.